package com.tentative.competition.web.controller.job;

import com.tentative.competition.schedule.service.ScheduleWorksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @auther: Smile Huang
 * @date: 2023/7/2 16:38
 * @desc:
 * @version: 2.0
 */

@Component
@EnableScheduling
public class SyncWorksUpvoteJob {

    @Autowired
    public ScheduleWorksService worksService;

    /**
     * 每天凌晨2点执行一次
     */
    @Scheduled(cron ="0 0 2 * * ?")
    public void syncWorksUpvoteCount() {
        worksService.syncWorksUpvoteCount();
    }

}
